﻿using System.ComponentModel;
using System.Windows;
using WP2BE.ViewModel;

namespace WP2BE
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
        }


        private void Window_Closing(object sender, CancelEventArgs e)
        {
            PostOptionViewModel optionViewModel = (PostOptionViewModel) base.DataContext;
            
            if (optionViewModel.IsDownloading)
            {
                MessageBox.Show(this, "You can not close the application while downloading images. \nStop the image downloading before closing the application",
                    "Info", MessageBoxButton.OK, MessageBoxImage.Asterisk);
                e.Cancel = true;
            }
        }

    }
}